package com.example.backend.mapper.generator;

import com.example.backend.mapper.po.AirPo;
import com.example.backend.mapper.po.AirPoExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface AirPoMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table air
     *
     * @mbg.generated
     */
    @Delete({
        "delete from air",
        "where `id` = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table air
     *
     * @mbg.generated
     */
    @Insert({
        "insert into air (`timestamp`, `value`)",
        "values (#{timestamp,jdbcType=TIMESTAMP}, #{value,jdbcType=REAL})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Integer.class)
    int insert(AirPo row);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table air
     *
     * @mbg.generated
     */
    @InsertProvider(type=AirPoSqlProvider.class, method="insertSelective")
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Integer.class)
    int insertSelective(AirPo row);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table air
     *
     * @mbg.generated
     */
    @SelectProvider(type=AirPoSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="timestamp", property="timestamp", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="value", property="value", jdbcType=JdbcType.REAL)
    })
    List<AirPo> selectByExample(AirPoExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table air
     *
     * @mbg.generated
     */
    @Select({
        "select",
        "`id`, `timestamp`, `value`",
        "from air",
        "where `id` = #{id,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="timestamp", property="timestamp", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="value", property="value", jdbcType=JdbcType.REAL)
    })
    AirPo selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table air
     *
     * @mbg.generated
     */
    @UpdateProvider(type=AirPoSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("row") AirPo row, @Param("example") AirPoExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table air
     *
     * @mbg.generated
     */
    @UpdateProvider(type=AirPoSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("row") AirPo row, @Param("example") AirPoExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table air
     *
     * @mbg.generated
     */
    @UpdateProvider(type=AirPoSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(AirPo row);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table air
     *
     * @mbg.generated
     */
    @Update({
        "update air",
        "set `timestamp` = #{timestamp,jdbcType=TIMESTAMP},",
          "`value` = #{value,jdbcType=REAL}",
        "where `id` = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(AirPo row);
}